/*
 * @Author: wangshuixin 2412658453@qq.com
 * @Date: 2024-06-17 09:03:26
 * @LastEditors: wangshuixin 2412658453@qq.com
 * @LastEditTime: 2024-06-17 13:34:50
 * @FilePath: \tspods\utils\input.ts
 * @Description: input输入框
 */
// input输入框获取焦点
export const inputFocus = (inputRef: Ref|HTMLInputElement) => {
  if (isRef(inputRef)) {
    nextTick(() => {
      const input = inputRef.value as HTMLInputElement
      input.focus()
    })
  } else if (inputRef instanceof HTMLInputElement || inputRef?.inputRef instanceof HTMLInputElement) {
    nextTick(() => {
      const input = inputRef as HTMLInputElement
      input.focus()
    })
  } else {
    throw new Error('函数inputFocus：传入的参数必须是Ref或HTMLInputElement类型')
  }
}